Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

docker containers have their own isolated environment that's separate from the host system's .env file. even if the user set COPILOT_API_KEY=sk-sim-copilot-xxxx in the .env file, the docker container running the simstudio service couldn't see that variable.

Fixes #1324

Type of Change

  • Bug fix

Testing

Tested manually.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Sep 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Sep 19, 2025 4:06am
sim Ready Ready Preview Comment Sep 19, 2025 4:06am

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR addresses a Docker container environment isolation issue that prevented the Copilot functionality from working in containerized deployments. The fix adds two environment variables (COPILOT_API_KEY and SIM_AGENT_API_URL) to all three Docker Compose configurations (docker-compose.local.yml, docker-compose.prod.yml, and docker-compose.ollama.yml).

The root cause was that Docker containers run in isolated environments and don't automatically inherit environment variables from the host system's .env file. Even when users correctly set COPILOT_API_KEY=sk-sim-copilot-xxxx in their .env file, the simstudio service running inside the Docker container couldn't access this variable, resulting in "Unauthorized request" errors in the Copilot panel.

The solution follows Docker Compose's standard pattern for environment variable propagation using ${VARIABLE_NAME} syntax. This allows Docker Compose to read values from the host environment (including .env files) and pass them into the containers at runtime. The changes are applied consistently across all deployment scenarios (local development, production, and Ollama-based setups) to ensure uniform behavior.

This fix integrates seamlessly with the existing codebase's Docker infrastructure, following the same patterns used for other environment variables like DATABASE_URL, BETTER_AUTH_SECRET, and ENCRYPTION_KEY that are already properly configured in these compose files.

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it only adds environment variable mappings without changing application logic
  • Score reflects the straightforward nature of the fix and consistent application across all Docker Compose files
  • No files require special attention as the changes follow established patterns and are identical across all three compose files

3 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 8e70a61 into staging Sep 19, 2025
5 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/docker branch September 19, 2025 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants